package config

import (
	"hyper/supports/configs"
)

func init() {

	configs.Add("queue", func() map[string]interface{} {
		return map[string]interface{}{

			"default": configs.Env("QUEUE_DRIVER", "redis"),
			// redis 链接
			"redis": map[string]interface{}{
				"host":     configs.Env("REDIS_HOST", "127.0.0.1"),
				"port":     configs.Env("REDIS_PORT", "6379"),
				"password": configs.Env("REDIS_PASSWORD", nil),
				"username": configs.Env("REDIS_USERNAME", nil),
				"prefix":   configs.Env("REDIS_PREFIX", "jybtx_"),

				// 业务类存储使用 1 (图片验证码、短信验证码、会话)
				"database": configs.Env("REDIS_DATABASE", 3),
			},

			// rabbitmq 链接
			"rabbitmq": map[string]interface{}{
				"host":     configs.Env("RABBITMQ_HOST", "127.0.0.1"),
				"port":     configs.Env("RABBITMQ_PORT", "5672"),
				"user":     configs.Env("RABBITMQ_USER", ""),
				"password": configs.Env("RABBITMQ_PASSWORD", ""),
			},

			// kafka 链接
			"kafka": map[string]interface{}{
				"host": configs.Env("KAFKA_HOST", "127.0.0.1"),
				"port": configs.Env("KAFKA_PORT", "9092"),
			},
		}
	})

}
